package com.luo.backend.dto;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 管理员-用户列表响应DTO
 */
public class AdminUserListResponse {
    
    private List<UserItem> items;
    private Pagination pagination;
    private Statistics statistics;
    
    public static class UserItem {
        private Long id;
        private String username;
        private String email;
        private String phone;
        private String realName;
        private String avatar;
        private String gender;
        private String role;
        private Integer status;
        private String statusText;
        private Long merchantId;
        private String merchantName;
        private LocalDateTime lastLoginAt;
        private LocalDateTime createdAt;
        private Long orderCount;
        private BigDecimal totalSpent;
        
        // Getters and Setters
        public Long getId() { return id; }
        public void setId(Long id) { this.id = id; }
        
        public String getUsername() { return username; }
        public void setUsername(String username) { this.username = username; }
        
        public String getEmail() { return email; }
        public void setEmail(String email) { this.email = email; }
        
        public String getPhone() { return phone; }
        public void setPhone(String phone) { this.phone = phone; }
        
        public String getRealName() { return realName; }
        public void setRealName(String realName) { this.realName = realName; }
        
        public String getAvatar() { return avatar; }
        public void setAvatar(String avatar) { this.avatar = avatar; }
        
        public String getGender() { return gender; }
        public void setGender(String gender) { this.gender = gender; }
        
        public String getRole() { return role; }
        public void setRole(String role) { this.role = role; }
        
        public Integer getStatus() { return status; }
        public void setStatus(Integer status) { this.status = status; }
        
        public String getStatusText() { return statusText; }
        public void setStatusText(String statusText) { this.statusText = statusText; }
        
        public Long getMerchantId() { return merchantId; }
        public void setMerchantId(Long merchantId) { this.merchantId = merchantId; }
        
        public String getMerchantName() { return merchantName; }
        public void setMerchantName(String merchantName) { this.merchantName = merchantName; }
        
        public LocalDateTime getLastLoginAt() { return lastLoginAt; }
        public void setLastLoginAt(LocalDateTime lastLoginAt) { this.lastLoginAt = lastLoginAt; }
        
        public LocalDateTime getCreatedAt() { return createdAt; }
        public void setCreatedAt(LocalDateTime createdAt) { this.createdAt = createdAt; }
        
        public Long getOrderCount() { return orderCount; }
        public void setOrderCount(Long orderCount) { this.orderCount = orderCount; }
        
        public BigDecimal getTotalSpent() { return totalSpent; }
        public void setTotalSpent(BigDecimal totalSpent) { this.totalSpent = totalSpent; }
    }
    
    public static class Pagination {
        private Integer currentPage;
        private Integer pageSize;
        private Long totalItems;
        private Integer totalPages;
        
        public Pagination(Integer currentPage, Integer pageSize, Long totalItems) {
            this.currentPage = currentPage;
            this.pageSize = pageSize;
            this.totalItems = totalItems;
            this.totalPages = (int) Math.ceil((double) totalItems / pageSize);
        }
        
        // Getters and Setters
        public Integer getCurrentPage() { return currentPage; }
        public void setCurrentPage(Integer currentPage) { this.currentPage = currentPage; }
        
        public Integer getPageSize() { return pageSize; }
        public void setPageSize(Integer pageSize) { this.pageSize = pageSize; }
        
        public Long getTotalItems() { return totalItems; }
        public void setTotalItems(Long totalItems) { this.totalItems = totalItems; }
        
        public Integer getTotalPages() { return totalPages; }
        public void setTotalPages(Integer totalPages) { this.totalPages = totalPages; }
    }
    
    public static class Statistics {
        private Long totalUsers;
        private Long customerCount;
        private Long merchantCount;
        private Long activeCount;
        private Long disabledCount;
        
        // Getters and Setters
        public Long getTotalUsers() { return totalUsers; }
        public void setTotalUsers(Long totalUsers) { this.totalUsers = totalUsers; }
        
        public Long getCustomerCount() { return customerCount; }
        public void setCustomerCount(Long customerCount) { this.customerCount = customerCount; }
        
        public Long getMerchantCount() { return merchantCount; }
        public void setMerchantCount(Long merchantCount) { this.merchantCount = merchantCount; }
        
        public Long getActiveCount() { return activeCount; }
        public void setActiveCount(Long activeCount) { this.activeCount = activeCount; }
        
        public Long getDisabledCount() { return disabledCount; }
        public void setDisabledCount(Long disabledCount) { this.disabledCount = disabledCount; }
    }
    
    // Getters and Setters
    public List<UserItem> getItems() { return items; }
    public void setItems(List<UserItem> items) { this.items = items; }
    
    public Pagination getPagination() { return pagination; }
    public void setPagination(Pagination pagination) { this.pagination = pagination; }
    
    public Statistics getStatistics() { return statistics; }
    public void setStatistics(Statistics statistics) { this.statistics = statistics; }
}






